package com.wh.service;

import com.wh.dao.BaseDao;
import com.wh.model.BaseModel;
import com.legend.utils.ReturnResult;
import org.apache.ibatis.session.SqlSession;

import java.util.Map;

public interface IBaseService {

    ReturnResult selectById(String id);

    ReturnResult editByModel(BaseModel model);

    ReturnResult editByMap(Map<String, Object> map);

    ReturnResult selectByMap(Map<String, Object> map);

    ReturnResult selectByMap(int pageIndex, int pageSize, Map<String, Object> map);
    /**
     * 记录总数
     * @param map
     * @return
     */
    int count(Map<String, Object> map);
    ReturnResult selectByModel(BaseModel model);

    ReturnResult delByIds(String ids);

    ReturnResult insertByModel(BaseModel model);

    /**
     * 播放数据，参数map
     *
     * @param map
     * @return
     */
    ReturnResult insertByMap(Map<String, Object> map);

    /**
     * 删除数据
     *
     * @param map
     * @return
     */
    ReturnResult delByMap(Map<String, Object> map);

    ReturnResult delByModel(BaseModel model);



    ReturnResult audit(Map<String, Object> map);

    ReturnResult audit(int state, String[] ids);

    ReturnResult sort(String sorts, String ids);

    ReturnResult sort(SqlSession session, BaseDao dao, String ids, String sorts);
}
